package Day02;

/**
 * @author feng
 * @Date 2022/1/2 8:02
 * 添加、修改、删除
 */
public class StringBufferTest {
    public static void main(String[] args) {
//        //添加
//        StringBuffer stringBuffer = new StringBuffer();
//        stringBuffer.append(4).append(false);
//        System.out.println(stringBuffer);
//        stringBuffer.insert(1, "haha");
//        System.out.println(stringBuffer);
//        //删除
//        StringBuffer buffer = new StringBuffer("sbc");
//        buffer.delete(0, 1);
//        System.out.println(buffer);
//        //清空缓冲区
//        buffer.delete(0, buffer.length());
//        //修改
//        StringBuffer abcd = new StringBuffer("abcd");
//        abcd.replace(0,1,"haha");
//        System.out.println(abcd);
//        abcd.setCharAt(0,'A');

    }
}
